package edu.ycxy.poetry.controller;


import edu.ycxy.poetry.entity.FanYi;
import edu.ycxy.poetry.service.IFanYiService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author @xin
 * @createDate 2022/3/8
 * @Description
 */
@RestController
@RequestMapping("/trans")
@Slf4j
public class FanYiController {

    @Autowired
    private IFanYiService fanYiService;

    //根据古诗的id,查询翻译的具体内容, 条件为 gid
    @RequestMapping("/{gid}")
    public List<FanYi> selectListToFanYi(@PathVariable("gid") Integer gid){
        log.debug("查询出的列表为:"+fanYiService.selectList(gid));
        return fanYiService.selectList(gid);
    }
}
